package com.tfswue.springboot_demo02.listener;

import jakarta.servlet.http.HttpSessionEvent;
import jakarta.servlet.http.HttpSessionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MySessionListener implements HttpSessionListener {
    private static final Logger log = LoggerFactory.getLogger(MyContextListener.class);

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        log.info("会话已创建，Session ID:{}" , se.getSession().getId());
        //可以在这里进行会话创建后的操作
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        log.info("会话已销毁，Session ID:{}" , se.getSession().getId());
        //可以在这里进行会话销毁后的操作
    }
}
